// Released in the Public Domain. http://creativecommons.org/licenses/publicdomain/
package org.xi8ix.async;

/**
 * Tracks statistics about the performance of various parts of the i/o framework.
 *
 * @author Iain Shigeoka
 */
public interface Statistics {
    /**
     * Get the time in milliseconds since the epoch when this port was created.
     *
     * @return the time in milliseconds since the epoch when this port was created.
     */
    long getStartTime();

    /**
     * Get the time in milliseconds since the epoch when the statistics for the port was last reset.
     *
     * @return the time in milliseconds since the epoch when the statistics for the port was last reset.
     */
    long getResetTime();

    /**
     * Resets the resetTime to 'now' and all statistics to zero.
     */
    void resetByteStatistics();

    void resetSendTimeStatistics();

    long getLastSend();

    void setLastSend(long lastSend);

    long getLastRecv();

    void setLastRecv(long lastRecv);

    long getTimeToFirstSend();

    void addTimeToFirstSend(long timeToFirstSend);

    void setTimeToFirstSend(long timeToFirstSend);

    long getTimeToFirstSendCount();

    void setTimeToFirstSendCount(long timeToFirstSendCount);

    long getInboundBytes();

    void addInboundBytes(long inboundBytes, int packets);

    void setInboundBytes(long inboundBytes);

    long getInboundPackets();

    void setInboundPackets(long inboundPackets);

    long getOutboundBytes();

    void addOutboundBytes(long outboundBytes, int packets);

    void setOutboundBytes(long outboundBytes);

    long getOutboundPackets();

    void setOutboundPackets(long outboundPackets);
}
